<?php

class Application_Model_RaceUnits extends Zend_Db_Table_Abstract
{
	protected $_unitsName = "units_name";
	protected $_unitsDescription = "units_description";
	protected $_unitsCost = "units_cost";
	protected $_unitsPower = 'units_power';
	protected $_unitsIncome = 'units_income';
	
	function getUnitsPowerForRaceID($race_id)
    {
		$select = $this->_db->select()
                            ->from($this->_unitsPower, array('lvl1', 'lvl2', 'lvl3','lvl4', 'lvl5', 'lvl6'))
                            ->where('race_id=?',$race_id);
                            
        $result = $this->getAdapter()->fetchRow($select);
    	return $result;
    }

	
	function getUnitsIncomeForRaceID($race_id)
    {
		$select = $this->_db->select()
                            ->from($this->_unitsIncome, array('lvl1', 'lvl2', 'lvl3','lvl4', 'lvl5', 'lvl6'))
                            ->where('race_id=?',$race_id);
                            
        $result = $this->getAdapter()->fetchRow($select);
    	return $result;
    }
    
	function getUnitsCostForRaceID($race_id)
    {
		$select = $this->_db->select()
                            ->from($this->_unitsCost, array('lvl1', 'lvl2', 'lvl3','lvl4', 'lvl5', 'lvl6'))
                            ->where('race_id=?',$race_id);
                            
        $result = $this->getAdapter()->fetchRow($select);
    	return $result;
    }
    
	function getUnitsNameForRaceID($race_id)
    {
		$select = $this->_db->select()
                            ->from($this->_unitsName, array('lvl1', 'lvl2', 'lvl3','lvl4', 'lvl5', 'lvl6'))
                            ->where('race_id=?',$race_id);
                            
        $result = $this->getAdapter()->fetchRow($select);
    	return $result;
    }
    
	function getUnitsDescriptionForRaceID($race_id)
    {
		$select = $this->_db->select()
                            ->from($this->_unitsDescription, array('lvl1', 'lvl2', 'lvl3','lvl4', 'lvl5', 'lvl6'))
                            ->where('race_id=?',$race_id);
                            
        $result = $this->getAdapter()->fetchRow($select);
    	return $result;
    }
    
    
}

